from fastapi import HTTPException, Depends
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials

security = HTTPBearer()


def check_token(credentials: HTTPAuthorizationCredentials = Depends(security)):
    if credentials.credentials != "your_permanent_token":
        raise HTTPException(status_code=403, detail="Invalid token")
    return credentials.credentials
